﻿using System;
using System.Web.UI;
using System.Web.Configuration;
using System.Data;
using System.Web.UI.WebControls;
public partial class manager_eval_View : System.Web.UI.Page
{
    DBHelper db = new DBHelper();
    public int psid = 0;
    public int Year = 0;
    public int Month = 0;
    public string zx_psid = "";
    public string userbh = "";


    public string num_1 = "0";
    public string num_2 = "0";
    public string num_3 = "0";
    public string num_4 = "0";
    public string num_5 = "0";


    protected void Page_Load(object sender, EventArgs e)
    {
        psid = Convert.ToInt32(Request.QueryString["psid"]);
        Year = Convert.ToInt32(Request.QueryString["Year"]);
        Month = Convert.ToInt32(Request.QueryString["Month"]);
        if (!IsPostBack)
        {
            bindData();
        }
    }
    private void bindData()
    {

        DataTable dt = db.getList("select * from v_A_Task where state=0  and Ry_Kh='" + psid + "'  and year='" + Year + "' and month='" + Month + "' order by id desc");
        rpt_Listask1.DataSource = dt;
        rpt_Listask1.DataBind();
        num_1 = dt.Rows.Count.ToString();

        DataTable dt2 = db.getList("select * from v_A_Task where state=0  and Ry_Bkh='" + psid + "'  and year='" + Year + "' and month='" + Month + "' order by id desc");
        rpt_Listask2.DataSource = dt2;
        rpt_Listask2.DataBind();
        num_2 = dt2.Rows.Count.ToString();

        DataTable dt3 = db.getList("select * from v_A_Task where state=1  and Ry_Kh='" + psid + "'  and year='" + Year + "' and month='" + Month + "' order by id desc");
        rpt_Listask3.DataSource = dt3;
        rpt_Listask3.DataBind();
        num_3 = dt3.Rows.Count.ToString();

        DataTable dt4 = db.getList("select * from v_A_Task where state=1  and Ry_Bkh='" + psid + "'  and year='" + Year + "' and month='" + Month + "' order by id desc");
        rpt_Listask4.DataSource = dt4;
        rpt_Listask4.DataBind();
        num_4 = dt4.Rows.Count.ToString();

        DataTable dt5 = db.getList("select * from v_A_Task where Ry_Kh='" + psid + "' and state=2  and year='" + Year + "' and month='" + Month + "' union select * from v_A_Task where Ry_Bkh='" + psid + "' and state=1 and task_state=0   and year='" + Year + "' and month='" + Month + "'");
        rpt_Listask5.DataSource = dt5;
        rpt_Listask5.DataBind();
        num_5 = dt5.Rows.Count.ToString();

    }
}